const scrollBottom = {
  bodyHeight: 0,
  updateHeight: function (val) {
    this.bodyHeight = val
  },
  onBottom: function (back) {
    let clientHeight = document.documentElement.clientHeight;
    window.onscroll = () => {
      if (this.bodyHeight != 0) {
        let scrollTop = document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
        if (this.bodyHeight - 160 <= scrollTop + clientHeight) {
          back()
        }
      }
    }
  }
}
export default scrollBottom